home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 46 / 046.d81 / match me (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  12KB  |  368 lines

  1. 5 print"":printchr$(142):dimnm$(12):dimn(12)
  2. 10 poke53281,0:poke53280,0:gosub3030:gosub3470
  3. 20 print"[144]";tab(3);k$;", press any key to play"
  4. 21 getc$:ifc$=""thengoto21
  5. 30 print"[147]";:poke53280,0:poke53281,0
  6. 50 dimcc(100):dimcp(100):c1=8:c2=8
  7. 70 print"":forx=1to16:print"";:next
  8. 90 print"              discard pile"
  9. 110 forx=17to24:print"";:next:print"             ";k$;"'s cards"
  10. 130 print"[151] joystick or cursor to move, * to quit"
  11. 140 print"[158]         match me if you can"
  12. 141 print"[152] stick down and fire or 'd' to draw card"
  13. 150 forct=1toc1
  14. 170 gosub 710
  15. 190 cc(ct)=z
  16. 210 next:gosub 2010
  17. 230 forct=1toc2
  18. 250 gosub 710
  19. 270 cp(ct)=z
  20. 290 next:gosub2130
  21. 310 gosub 710:ifz>100 then goto310
  22. 330 d=z
  23. 350 print"";
  24. 370 pd=d:gosub 990
  25. 390 print"                                       "
  26. 410 print"                ";nm$(11);"'s turn"
  27. 430 c=1:gosub2850:poke53280,2:gosub830
  28. 450 if c2=0 then goto 2890
  29. 470 if ga=1 then ga=0:goto 390
  30. 490 print"                                       "
  31. 510 print"              computer's turn":poke53280,6
  32. 530 if tt=1 then gosub710:c1=c1+1:cc(c1)=z:gosub2010:gosub710:c1=c1+1
  33. 550 iftt=1 thentt=0:cc(c1)=z:gosub2010
  34. 570 gosub2850:poke53280,6
  35. 590 gosub 2250
  36. 610 if c1=0 then k$="computer":nm$(11)="computer":goto2890
  37. 630 if ga=1 then ga=0:goto490
  38. 650 if tt=1 then gosub710:c2=c2+1:cp(c2)=z:gosub2130:gosub710:c2=c2+1
  39. 670 iftt=1 thentt=0:cp(c2)=z:gosub2130
  40. 690 goto 390
  41. 710 w=int(rnd(1)*4):rem type
  42. 730 x=int(rnd(1)*4)+1:rem color
  43. 750 y=int(rnd(1)*9)+1:rem number
  44. 770 ifw>oandy/2<>int(y/2)thenw=w-1
  45. 790 z=y+(x*10)+(w*100)
  46. 810 return
  47. 830 dm=1:print"";:fortc=1toc2
  48. 831 iftc=1 then goto835
  49. 833 print"[157][157][157][157][145][145][145][145]";:    rem   print"[145][145][145][145][157][157][157][157] [157] [157] [157] [157] [145][145][145][145]";
  50. 835 pd=cp(tc):gosub990
  51. 839 next:c=1
  52. 840 print"^[157]";
  53. 841 j=peek(56320):getb$:ifb$="*"then gosub4000
  54. 842 if(j=119orb$="")andc<c2thenc=c+1:pd=cp(c):print"  ^[157]";
  55. 843 if(j=123orb$="[157]")andc>1thenc=c-1:pd=cp(c):print" [157][157][157]^[157]";
  56. 844 if(j=111orb$=chr$(13)) thenrt=1:dm=0:gosub1370:ifrt=0then dm=0:return
  57. 845 if j=109 or b$="d"then w=4:goto1370
  58. 846 goto 841
  59. 849 print"";:pd=cp(1):c=1
  60. 850 gosub 990
  61. 870 print"";
  62. 890 j=peek(56320):getb$:ifb$="*"thengosub4000
  63. 910 ifj=119andc<c2+1thenc=c+1:pd=cp(c):gosub990
  64. 930 ifj=123andc>1thenc=c-1:pd=cp(c):gosub990
  65. 950 ifj=111 thenrt=1:dm=0:gosub1370:ifrt=0then dm=0:return
  66. 970 goto 870
  67. 990 if pd=0 then pd=400
  68. 1010 w=(int(pd/100))
  69. 1030 x=(int((pd-(w*100))/10))
  70. 1050 y=(pd-(w*100)-(x*10)):ifch=1thenreturn
  71. 1070 if x=1 then print"";
  72. 1090 if x=2 then print"";
  73. 1110 if x=3 then print"[158]";
  74. 1130 if x=4 then print"";
  75. 1150 if w>=3 then print"[151]";
  76. 1170 if pd=400 then print"[146]";
  77. 1190 ifdm=.thenprint"";
  78. 1210 print"     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [145][145][145][145][157][157][157][157][157]";
  79. 1220 ifpd<100thenm$=right$(str$(y),1)
  80. 1230 ifpd>99then1245
  81. 1235 printm$""m$"[157][157][157]"m$"[157][157][157]"m$""m$"";
  82. 1237 if(dm=.)or(tc=c2)then1250
  83. 1240 print"[145][145][145][145][157][157][157][157][157][167]   [157][157][157][157][167]   [157][157][157][157][167]   [157][157][157][157][167]   [157][157][157][157][167]   ";
  84. 1245 if(dm=.)or(tc=c2)then1280
  85. 1250 if w=1 then print"g[167][157][157]o[167][157][167][157][157]g[167][157][157]o[167][145][145][145][145]g[157]o[157]g[157]o[146]";
  86. 1260 if w=2 then print"d[167][157][157]r[167][157][157]a[167][157][157]w[167][157][157]2[167][145][145][145][145]d[157]r[157]a[157]w[157]2[146]";
  87. 1270 if w=3 then print"w[167][157][157]i[167][157][157]l[167][157][157]d[167][157][167][145][145][145][145]w[157]i[157]l[157]d[146]";
  88. 1275 goto 1310
  89. 1280 if w=1 then print"g [157][157]o [157] [157][157]g [157][157]o [145][145][145][145]g[157]o[157]g[157]o[146]";
  90. 1290 if w=2 then print"d [157][157]r [157][157]a [157][157]w [157][157]2 [145][145][145][145]d[157]r[157]a[157]w[157]2[146]";
  91. 1300 if w=3 then print"w [157][157]i [157][157]l [157][157]d [157][145][145][145][145]w[157]i[157]l[157]d[146]";
  92. 1310 if w=4 then print"pick[157][157][157][157]a   [157][157][157][157]card"
  93. 1330 print"[146]";:return
  94. 1370 ifw=4 then rt=0:goto 1670
  95. 1390 ifcp(c)>=300andcp(c)<400thenrt=0:goto1530
  96. 1410 ch=1:pd=(cp(c)):gosub 1010:ww=w:xx=x:yy=y
  97. 1430 pd=d:gosub 1010:ch=0
  98. 1431 poke896,w:poke897,x:poke898,y:poke899,ww:poke900,xx:poke901,yy
  99. 1432 if(w<>ww and x<>xx and y<>yy)then goto1730
  100. 1433 ifw=0thenif(w=ww)and((y<>yy)and(x<>xx))then goto 1730
  101. 1434 ifw<>ww and x<>xx and y=yythen goto1730
  102. 1450 ifw>=1andw=wworx=xxthenrt=0:goto1510
  103. 1470 ifw=0andy=yythenrt=0:goto1510
  104. 1490 goto 1730
  105. 1510 print"";:forct=1to8:print"                             ";
  106. 1511 print"          ":next
  107. 1530 pd=cp(c):d=pd:print"";:gosub1010
  108. 1550 rt=0:ch=0
  109. 1570 ch=0:cp(c)=0:gosub2130:c2=c2-1
  110. 1590 ifw=3 thenxg=0:gosub 1770:d=(300+(x*10)):ga=0:goto1650
  111. 1610 if ww=1thenga=1
  112. 1630 ifww=2thentt=1
  113. 1650 rt=0:return
  114. 1670 c2=c2+1:gosub710:cp(c2)=z:rt=0:gosub 2130
  115. 1690 print"";:forct=1to8:print"                             ";
  116. 1691 print"          ":next
  117. 1710 c=1:ch=0:return
  118. 1730 print" ^[157]";:pd=cp(1):c=1
  119. 1750 rt=1:return:gosub 990:return
  120. 1770 print"[158]color of wild card[146]"
  121. 1790 w=0:x=1:pd=101
  122. 1810 print"";:gosub1070
  123. 1830 print"";
  124. 1850 j=peek(56320):getb$:e$=chr$(13)
  125. 1870 if(j=119orb$="")andx<4thenx=x+1:gosub 1070
  126. 1890 if(j=123orb$="[157]")andx>1thenx=x-1:gosub1070
  127. 1910 if(j=111orb$=e$)andxg>10then w=3:print"";:gosub1190:goto1950
  128. 1930 xg=xg+1:goto 1830
  129. 1950 print"                              "
  130. 1970 print"";:forct=1to8:print"                             ";
  131. 1971 print"          ":next
  132. 1990 return
  133. 2010 fory=1toc1-1
  134. 2030 forz=y+1toc1
  135. 2050 ifcc(y)>=cc(z)thengoto 2090
  136. 2070 s=cc(z):cc(z)=cc(y):cc(y)=s
  137. 2090 next z
  138. 2110 next y:return
  139. 2130 fory=1toc2-1
  140. 2150 forz=y+1toc2
  141. 2170 ifcp(y)>=cp(z)thengoto 2210
  142. 2190 s=cp(z):cp(z)=cp(y):cp(y)=s
  143. 2210 next z
  144. 2230 next y:return
  145. 2250 wo=1:print"                        [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";
  146. 2270 a=int(d/100)
  147. 2290 b=int((d-(a*100))/10)
  148. 2310 c=d-(a*100)-(b*10)
  149. 2330 forct=1toc1
  150. 2350 aa=int(cc(ct)/100)
  151. 2370 bb=int((cc(ct)-(aa*100))/10)
  152. 2390 cj=cc(ct)-(aa*100)-(bb*10)
  153. 2410 ifaa>=1andaa=aorbb=bthengoto2510
  154. 2430 ifaa=0andcj=cthenpd=1:goto2510
  155. 2450 next
  156. 2470 print"   computer drew a card"
  157. 2490 c1=c1+1:gosub710:cc(c1)=z:gosub 2010:return
  158. 2510 print"";
  159. 2530 ifaa=1thenga=1
  160. 2550 ifaa=2thentt=1
  161. 2570 d=cc(ct):cc(ct)=0:gosub2010:c1=c1-1
  162. 2590 print"[146]";
  163. 2610 ifbb=1 then print"";
  164. 2630 ifbb=2 then print"";
  165. 2650 ifbb=3 then print"[158]";
  166. 2670 ifbb=4 then print"";
  167. 2690 e=cj:print"";
  168. 2710 print"     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [157][157][157][157][157]     [145][145][145][145][157][157][157][157][157][157]";
  169. 2730 if aa=0 then printe;"";e;"[157][157][157][157][157]";e;"[157][157][157][157][157]";e;"";e;"[144][157][157][157][157][157][157][157] [145][145][145][145][157] [146]"
  170. 2750 ifaa=1 then print"g[157]o[157]g[157]o[145][145][145][145]g[157]o[157]g[157]o[146]"
  171. 2770 ifaa=2 then print"d[157]r[157]a[157]w[157]2[145][145][145][145]d[157]r[157]a[157]w[157]2[146]"
  172. 2790 ifaa=3 then print"w[157]i[157]l[157]d[157][145][145][145][145]w[157]i[157]l[157]d[146]"
  173. 2810 ifw=4 then print"pick[157][157][157][157]a   [157][157][157][157]card"
  174. 2830 return
  175. 2850 print"[156]computer has";c1;"[157] cards left  "
  176. 2870 print"";k$;" has";c2;"[157] cards left  "
  177. 2875 if c1>=18 then c2=0:goto2890
  178. 2876 if c2>=18 then c1=0:k$="computer":nm$(11)="computer":goto2890
  179. 2877 return
  180. 2890 print"[147][156]